import 'package:flutter/material.dart';
import 'package:kq_flutter_core_widget/utils/kq_screen_util.dart';
import 'package:get/get.dart';
import 'package:kq_flutter_core_widget/utils/toast_util.dart';
import 'package:kq_flutter_core_widget/widgets/button/kq_ink_well.dart';
import 'package:kq_flutter_core_widget/widgets/image/kq_image.dart';
import 'package:kq_flutter_tv_widgets/resources/kq_theme_colors.dart';
import 'package:kq_flutter_tv_widgets/theme/kq_theme_manager.dart';
import 'package:kq_flutter_tv_widgets/utils/dialog_util.dart';
import 'package:kq_flutter_tv_widgets/utils/native/scan_native_util.dart';
import 'package:kq_flutter_tv_widgets/widgets/bottomTabBar/kq_bottom_tab_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/button/kq_count_down_button.dart';
import 'package:kq_flutter_tv_widgets/widgets/button/kq_head_button.dart';
import 'package:kq_flutter_tv_widgets/widgets/button/kq_outline_button.dart';
import 'package:kq_flutter_tv_widgets/widgets/detailsItemView/kq_details_item_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/formItem/entity/kq_form_entity.dart';
import 'package:kq_flutter_tv_widgets/widgets/formItem/kq_edit_more_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/formItem/kq_header_item_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/formItem/kq_more_auto_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/formItem/kq_no_auto_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/noticeView/kq_notice_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/progressbar/kq_dashboard_progress_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/progressbar/kq_horizontal_progress_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/progressbar/ring_progress_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/rainbowBar/kq_rainbow_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/rainbowBar/kq_rainbow_tips_builder.dart';
import 'package:kq_flutter_tv_widgets/widgets/rainbowBar/kq_rainbow_value.dart';
import 'package:kq_flutter_tv_widgets/widgets/searchBar/kq_search_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/seekbar/two_button_seek_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/seekbar/two_button_seek_bar2.dart';
import 'package:kq_flutter_tv_widgets/widgets/seekbar/one_button_seek_bar.dart';
import 'package:kq_flutter_tv_widgets/widgets/specialView/kq_special_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/steps/kq_horizontal_steps.dart';
import 'package:kq_flutter_tv_widgets/widgets/tabView/kq_tab_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/tagView/kq_icon_tag.dart';
import 'package:kq_flutter_tv_widgets/widgets/tagView/kq_number_tag_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/tagView/kq_tag_view.dart';
import 'package:kq_flutter_tv_widgets/widgets/textFiled/kq_textfiled.dart';
import 'package:kq_flutter_tv_widgets/widgets/chooseItemView/kq_choose_item_view.dart';

import '../../resources/Images.dart';
import '../../router/route_map.dart';

/// 自定义控件演示页面
class CustomViewsPage extends StatefulWidget {
  const CustomViewsPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return CustomViewsPageState();
  }
}

class CustomViewsPageState extends State<CustomViewsPage> {
  final GlobalKey<CustomViewsPageState> key = GlobalKey();
  final GlobalKey<KqRainbowBarState> keyRainbowBar =
      GlobalKey<KqRainbowBarState>();

  var checked = false;

  var titles = ['One', 'Two', 'Three', 'Four', 'Five', 'Six'];
  var _selectedIndex = 0;
  int current = 0;
  List steps = [
    {'title': '咨询单填写', 'state': '1'},
    {'title': '提交询价', 'state': '0'},
    {'title': '办事处回复', 'state': '0'}
  ];

  String testText = "";

  KqFormEntity moreEntity = KqFormEntity(
      itemType: ItemType.custom,
      title: '复合板',
      hint: '请输入',
      mustInput: true,
      showUnit: false);
  KqFormEntity unitEntity = KqFormEntity(
      itemType: ItemType.custom,
      title: '复合板',
      hint: '请输入',
      mustInput: true,
      showUnit: true);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        padding: EdgeInsets.symmetric(horizontal: 20.r, vertical: 20.r),
        child: Column(
          children: [
            KqSearchBar(
              hintText: '请扫描产品条码',
              editable: false,
              customLeftIcon: Image.asset(
                Images.demoIcSaoma,
                width: 28.r,
                height: 28.r,
              ),
              // editController: controller.editingController,
              enableScan: true,
              placeHolderTextColor: Colors.black.withOpacity(0.25),
              outerBgColor: KqThemeColors.bgTransparent,
              innerBgColor: KqThemeColors.bgTransparent,
              autoFocusBorder: true,
              onTap: (searchState) {
                if (searchState.isFocused()) {
                  searchState.clearFocus();
                  KqDialog.showInputDialog(
                    "产品条码",
                    defValue: searchState.getSearchText(),
                    allowEmpty: true,
                    onConfirm: (value) {
                      // controller.searchProduct(value, searchState);
                      print(value);
                    },
                    onDismiss: () {
                      searchState.requestFocus();
                    },
                  );
                } else {
                  searchState.requestFocus();
                }
              },
              onSubmit: (text, searchState) {
                if (searchState.isFocused()) {
                  // controller.searchProduct(text, searchState);
                  print(text);
                }
              },
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'KqTagView演示')),
            Row(
              children: [
                KqTagView(
                  text: '待生产',
                  textColor: KqThemeColors.textYellow,
                  borderColor: KqThemeColors.textYellow,
                  radius: 2.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqTagView(
                  text: '生产中',
                  textColor: KqThemeColors.textGreen,
                  borderColor: KqThemeColors.textGreen,
                  radius: 2.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqTagView(
                  text: '已完成',
                  textColor: KqThemeColors.textRed,
                  borderColor: KqThemeColors.textRed,
                  radius: 2.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqTagView(
                  text: '已挂起',
                  dashLine: true,
                  textColor: KqThemeColors.textYellow,
                  borderColor: KqThemeColors.textYellow,
                  radius: 2.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqTagView(
                  text: '带背景色',
                  dashLine: true,
                  backgroundColor: KqThemeColors.textGreen,
                  textColor: KqThemeColors.textLightBlue,
                  borderColor: KqThemeColors.bgWhite,
                  radius: 2.r,
                ),
              ],
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(entity: KqFormEntity(title: "KqImage 演示")),
            Row(
              children: [
                KqImage.oss(
                  radius: 10.r,
                  url:
                  '2c9280846468765a016468fbe11b0121/product/aadb70ee-07ca-4b56-af90-defee2042ebb&2.5.5.png',
                  width: 100.r,
                  height: 100.r,
                  fit: BoxFit.fill,
                ),
                SizedBox(
                  width: 10.r,
                  height: 10.r,
                ),
                KqImage.http(
                  radius: 10.r,
                  url:
                  'https://img1.baidu.com/it/u=2527732730,3137228782&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1677949200&t=615911fe42ee6d10a288bba35771b868',
                  width: 100.r,
                  height: 100.r,
                  fit: BoxFit.cover,
                ),
                SizedBox(
                  width: 10.r,
                  height: 10.r,
                ),
                KqImage.assets(
                  url: Images.demoIcTouxiang,
                  width: 100.r,
                  height: 100.r,
                  fit: BoxFit.cover,
                )
              ],
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'IconTagView演示')),
            Row(
              children: [
                KqIconTagView(
                  text: '已生产',
                  iconPath: Images.demoIcChanxian12Black,
                  textColor: KqThemeColors.textGreen,
                  backgroundColor: KqThemeColors.textRed,
                  // witdh: 100.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqIconTagView(
                  text: '生产中',
                  iconPath: Images.demoIcZhuangtai12Black,
                  backgroundColor: KqThemeColors.textYellow,
                  viewType: 2,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqIconTagView(
                  text: '水电费水电费撒发的发',
                  iconPath: Images.demoIcChanxian12Black,
                  textColor: KqThemeColors.textGreen,
                  // backgroundColor: KqThemeColors.textRed,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  maxLines: 2,
                  iconHeight: 20.r,
                  width: 80.r,
                ),
                SizedBox(
                  width: 10.r,
                  height: 1.r,
                ),
                KqIconTagView(
                  text: '水电费水电费撒发的发',
                  iconPath: Images.demoIcChanxian12Black,
                  backgroundColor: KqThemeColors.textYellow,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  leftText: '按时大大是的',
                  maxLines: 2,
                  viewType: 3,
                  iconWidth: 50.r,
                  width: 130.r,
                ),
                //  SizedBox(
                //   width: 10.r,
                //   height: 1.r,
                // ),
                // IconTagView(
                //   text: '水电费水电费撒发的发',
                //   iconPath: Images.taskIcChanxian12Black,
                //   textColor: KqThemeColors.textGreen,
                //   backgroudColor: KqThemeColors.textRed,
                //   maxLines: 2,
                //   witdh: 100.r,
                // ),
              ],
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqRainbowBar(彩虹条)演示')),
            KqRainbowBar(
              height: 24.r,
              key: keyRainbowBar,
              showTips: true,
              data: [
                KqRainbowValue(
                    value: 20,
                    color: KqThemeColors.textGreen,
                    text: "工作\n2023-03-07 11:00 -> 2023-03-07 11:20"),
                KqRainbowValue(
                    value: 20,
                    color: KqThemeColors.textRed,
                    text: "异常\n2023-03-07 11:20 -> 2023-03-07 11:40"),
                KqRainbowValue(
                    value: 2,
                    color: KqThemeColors.textGreen,
                    text: "工作\n2023-03-07 11:40 -> 2023-03-07 11:42"),
                KqRainbowValue(
                    value: 7,
                    color: KqThemeColors.text8C,
                    text: "离线\n2023-03-07 11:42 -> 2023-03-07 11:49"),
                KqRainbowValue(
                    value: 5,
                    color: KqThemeColors.textGreen,
                    text: "工作\n2023-03-07 11:49 -> 2023-03-07 11:54"),
                KqRainbowValue(
                    value: 10,
                    color: KqThemeColors.textYellow,
                    text: "空闲\n2023-03-07 11:54 -> 2023-03-07 12:04"),
                KqRainbowValue(
                    value: 20,
                    color: Colors.white,
                    text: "无状态\n2023-03-07 12:04 -> 2023-03-07 12:24"),
                KqRainbowValue(
                    value: 40,
                    color: KqThemeColors.text8C,
                    text: "离线\n2023-03-07 12:24 -> 2023-03-07 13:04"),
                KqRainbowValue(
                    value: 10,
                    color: KqThemeColors.textYellow,
                    text: "空闲\n2023-03-07 13:04 -> 2023-03-07 13:14"),
              ],
              rainbowBarMoveListener: (position, dialogShowPositionLocal,
                  dialogShowPositionGlobal, value) {
                KqToast.showNormal(position.toString());
              },
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqNoticeView公告栏演示')),
            const KqNoticeView(
              content: '这是一条公告，内容很长很长很长很长很长很长很长很长。',
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqDetailsItemView 通用详情Item演示')),
            const KqDetailsItemView(
              title: '标题',
              showMustInput: true,
              content: '内容内容',
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqDragGridView 拖拽排序演示')),
            Row(
              children: [
                KqOutlineButton(
                  title: '去演示（网格）',
                  onTap: (disabled) => RouteMap.pushDragGridViewDemo(),
                ),
                KqOutlineButton(
                  title: '去演示（列表）',
                  onTap: (disabled) => RouteMap.pushDragListViewDemoPage(),
                ),
                KqOutlineButton(
                  title: '去演示（仿抽屉）',
                  onTap: (disabled) => RouteMap.pushDragDrawerDemo(),
                )
              ],
            ),
            SizedBox(
              width: 1.r,
              height: 10.r,
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'KqTabBar 演示')),
            Row(
              children: [
                KqOutlineButton(
                  title: '去演示',
                  onTap: (disabled) {
                    RouteMap.pushTabBarDemo();
                  },
                )
              ],
            ),
            KqHeaderItemView(
                entity: KqFormEntity(
                    title: 'KqSectionGridView，KqSectionListView分区演示')),
            Row(
              children: [
                KqOutlineButton(
                  title: '分区网格',
                  onTap: (disabled) => RouteMap.pusSectionGridViewDemo(),
                ),
                KqOutlineButton(
                    title: '分区列表',
                    onTap: (disabled) => RouteMap.pusSectionListView()),
              ],
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'ChartView 图表演示')),
            Row(
              children: [
                KqOutlineButton(
                  title: '曲线折线图',
                  onTap: (disabled) => RouteMap.pushKqChartLineDemo(),
                ),
                KqOutlineButton(
                  title: '扇形分布图',
                  onTap: (disabled) => RouteMap.pushKqChartPieDemo(),
                )
              ],
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqNumberTagView 数字角标演示')),
            Row(
              children: [
                const KqNumberTagView(
                  number: 1,
                  backgroundColor: KqThemeColors.bgWhite,
                  borderColor: KqThemeColors.textRed,
                  borderWidth: 1,
                  textColor: KqThemeColors.textRed,
                ),
                SizedBox(
                  width: 5.r,
                  height: 1.r,
                ),
                const KqNumberTagView(
                  number: 10,
                  max: 99,
                ),
                SizedBox(
                  width: 5.r,
                  height: 1.r,
                ),
                const KqNumberTagView(
                  number: 1000,
                  backgroundColor: KqThemeColors.textLightBlue,
                ),
                SizedBox(
                  width: 5.r,
                  height: 1.r,
                ),
                const KqNumberTagView(
                  number: 100,
                  max: 99,
                ),
              ],
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'RingProgressBar 带倒计时环型进度条')),
            RingProgressBar(
              radius: 50,
              strokeWidth: 10,
              isShowText: true,
              maxProgress: 10,
              callback: () {
                print("callback回调了");
              },
            ),
            KqHeaderItemView(
                entity:
                KqFormEntity(title: 'KqHorizontalProgressBar 二级水平进度条')),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqHorizontalProgressBar(
              height: 12.r,
              progress: 80,
              secondProgress: 50,
              radius: 3.r,
              enableSecondProgress: true,
              secondProgressShape: SecondProgressShape.roundRect,
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqHorizontalProgressBar(
              height: 12.r,
              progress: 60,
              secondProgress: 30,
              radius: 0,
              enableSecondProgress: true,
              secondProgressShape: SecondProgressShape.roundRect,
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqHorizontalProgressBar(
              height: 12.r,
              progress: 50,
              secondProgress: 30,
              radius: 10.r,
              enableSecondProgress: true,
              secondProgressShape: SecondProgressShape.point,
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqTextFiled 固定高度演示')),
            Container(
              width: context.width,
              height: 120.r,
              color: KqThemeColors.lineColor,
              padding: EdgeInsets.all(14.r),
              child: const KqTextFiled(
                useParentHeight: true,
                showBorder: true,
                multiline: true,
              ),
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'KqSearchBar 演示')),
            Container(
              width: context.width,
              color: KqThemeColors.lineColor,
              child: KqSearchBar(
                onSubmit: (value, state) => KqToast.showNormal(value),
              ),
            ),
            KqHeaderItemView(
                entity:
                KqFormEntity(title: 'TwoButtonSeekBar 带两个按钮的SeekBar')),
            TwoButtonSeekBar(
              oneSeekBarValueFormat: (value) {
                return "$value%";
              },
            ),
            KqHeaderItemView(
                entity:
                KqFormEntity(title: 'TwoButtonSeekBar2 带两个按钮的SeekBar')),
            TwoButtonSeekBar2(
              oneSeekBarValueFormat: (value) {
                return "$value%";
              },
            ),
            KqHeaderItemView(
                entity:
                KqFormEntity(title: 'OneButtonSeekBar 带一个按钮的SeekBar')),
            OneButtonSeekBar(
              oneSeekBarValueFormat: (value) {
                return "$value%";
              },
            ),
            KqHeaderItemView(entity: KqFormEntity(title: '二维码扫描')),
            KqOutlineButton(
              title: '开始扫描',
              onTap: (disabled) {
                ScanNativeUtil.scanWithCallback(
                  callback: (result) {
                    if (result.isCancel) {
                      return;
                    }
                    KqToast.showNormal(result.content);
                  },
                );
              },
            ),
            const KqTabView(
              titles: ['删除Normal', '提交Normal'],
              colorTypes: [ColorType.lineBlue, ColorType.fillBlue],
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            const KqTabView(
              titles: ['保存Nomal', '提交Normal'],
              colorTypes: [ColorType.lineBlue, ColorType.fillBlue],
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqTabView(
              tabIndexBlock: (index, disable) {
                List<DropdownMenuItem> getddd = [];
                final DropdownMenuItem item1 = DropdownMenuItem(
                  child: Text('背景'),
                  value: '背景',
                );
                final DropdownMenuItem item2 = DropdownMenuItem(
                  child: Text('面试南昌分'),
                  value: '面试南昌分',
                );
                final DropdownMenuItem item3 = DropdownMenuItem(
                  child: Text('vehviuoerfb'),
                  value: 'vehviuoerfb',
                );
                getddd.add(item1);
                getddd.add(item2);
                getddd.add(item3);

                KqDialog.showCustomDialog(
                    title: '挂起原因',
                    customWidget: Container(
                      padding: EdgeInsets.symmetric(horizontal: 16.r),
                      child: Column(
                        children: [
                          DropdownButtonHideUnderline(
                              child: Container(
                                height: 40.r,
                                padding: EdgeInsets.symmetric(horizontal: 12.r),
                                decoration: BoxDecoration(
                                    borderRadius:
                                    BorderRadius.all(Radius.circular(2)),
                                    border: Border.all(
                                        width: 1, color: KqThemeColors.bgD)),
                                child: DropdownButton(
                                    isDense: true,
                                    isExpanded: true,
                                    value: '面试南昌分',
                                    // selectedItemBuilder: (context) {
                                    //   return [
                                    //     const Text(
                                    //       '面试南昌分',
                                    //       maxLines: null,
                                    //       overflow: TextOverflow.ellipsis,
                                    //     )
                                    //   ];
                                    // },
                                    items: getddd,
                                    style: TextStyle(color: KqThemeColors.text26),
                                    onChanged: ((value) {})),
                              )),
                          Padding(
                            padding: EdgeInsets.symmetric(vertical: 10.r),
                            child: KqTextFiled(
                              fixedHeight: 100.r,
                              fontSize: 16.sp,
                              useParentHeight: true,
                              maxLines: null,
                              outerPadding: EdgeInsets.symmetric(
                                  horizontal: 12.r, vertical: 8.r),
                              placeHolder: '请补充说明',
                              outerDecoration: BoxDecoration(
                                  borderRadius:
                                  BorderRadius.all(Radius.circular(2.r)),
                                  border:
                                  Border.all(color: KqThemeColors.bgD)),
                            ),
                          )
                        ],
                      ),
                    ),
                    customBtnWidget: (context, onCancel) {
                      return Row(
                        children: [
                          Expanded(
                              child: KqInkWell(
                                onTap: () {
                                  Navigator.pop(context);
                                  onCancel?.call();
                                },
                                child: Container(
                                  alignment: Alignment.center,
                                  width: double.infinity,
                                  height: 48.r,
                                  child: Text(
                                    "自定义按钮",
                                    style: TextStyle(
                                        fontSize: 16.sp,
                                        color: KqThemeManager.instance
                                            .getConfig()
                                            .dialogConfig
                                            .mainBtnColor ??
                                            KqThemeColors.textLightBlue),
                                  ),
                                ),
                              ))
                        ],
                      );
                    });
              },
              titles: const ['保存Disable', '提交Disable'],
              colorTypes: const [ColorType.lineBlue, ColorType.fillBlue],
            ),
            SizedBox(
              width: 5.r,
              height: 4.r,
            ),
            KqSpecialView(
                data: KqFormEntity(
                    itemType: ItemType.custom,
                    mustInput: true,
                    editable: true,
                    title: '模仁')),
            KqSpecialView(
                data: KqFormEntity(
                    itemType: ItemType.custom,
                    mustInput: true,
                    editable: false,
                    valueForShow: 'sfds,dsff,ewwewedd',
                    title: '模仁')),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'kqCountDownButton 倒计时按钮')),
            KqNoAutoView(
                entity: KqFormEntity(
                    itemType: ItemType.custom,
                    mustInput: true,
                    editable: true,
                    title: '维修单号')),
            KqNoAutoView(
                entity: KqFormEntity(
                    itemType: ItemType.custom,
                    mustInput: true,
                    editable: false,
                    valueForShow: '202303071042',
                    title: '维修单号')),
            KqMoreAutoView(
              data: moreEntity,
              didSelect: (entity) {
                setState(() {
                  entity.title = '111';
                });
              },
            ),
            KqMoreAutoView(data: unitEntity),
            // KqHorizontalSteps(
            //     isDashed: true,
            //     controller: KqStepsController(currentIndex: current),
            //     callBack: ((index) {
            //       setState(() {
            //         if (current <= index) {
            //           //当前点的是后面
            //           if (steps.length > index) {
            //             Map item = steps[index];
            //             item['state'] = '1';
            //           }
            //         } else {
            //           for (var i = index + 1; i <= current; i++) {
            //             Map item = steps[i];
            //             item['state'] = '0';
            //           }
            //         }
            //         current = index;
            //       });
            //     }),
            //     steps: steps.map((e) {
            //       return KqStep(
            //           stepContentText: e['title'],
            //           state: e['state'] == '0'
            //               ? KqStepState.indexed
            //               : e['state'] == '1'
            //                   ? KqStepState.doing
            //                   : KqStepState.complete,
            //           doingIcon: const Icon(
            //             Icons.mode_standby,
            //             color: KqThemeColors.textLightBlue,
            //           ),
            //           indexedIcon: const Icon(
            //             Icons.mode_standby,
            //             color: KqThemeColors.text999,
            //           ));
            //     }).toList()),
            KqHeaderItemView(
                entity: KqFormEntity(
                    title: 'KqTextFiled功能扩展，可监控TextFiled的输入停顿演示')),
            const Text("请连在下面的输入框续输入然后停顿："),
            KqTextFiled(
              onMonitor: (str) {
                setState(() {
                  testText = "暂停输入，值：$str";
                });
              },
            ),
            Text(testText),
            KqHeaderItemView(
                entity:
                KqFormEntity(title: 'KqDashboardProgressBar 驾驶舱进度条演示')),
            const KqDashboardProgressBar(
              centerText: "80",
              centerTextUnit: "%",
              bottomText: "底部文字",
              sweepScale: 80,
            ),
            KqEditMoreView(
                entity: KqFormEntity(title: '咨询', mustInput: true)),
            SizedBox(
              width: 10.r,
              height: 20.r,
            ),
            KqHeaderItemView(entity: KqFormEntity(title: 'checkbox演示')),
            KqHeaderItemView(
                entity: KqFormEntity(title: 'KqChooseItemView 演示')),
            KqChooseItemView(
              title: "左边显示checkBox",
              direction: CheckBoxDirection.left,
              onItemTap: (checked) {
                KqToast.showNormal("checked:$checked");
              },
            ),
            KqChooseItemView(
              title: "右边边显示checkBox",
              direction: CheckBoxDirection.right,
              onItemTap: (checked) {
                KqToast.showNormal("checked:$checked");
              },
            ),
          ],
        ),
      ),
      bottomNavigationBar: KqBottomTabBar(
        icons: [
          Images.demoIcBanbenhao,
          Images.demoIcBanbenhao,
          Images.demoIcBanbenhao
        ],
        activeIcons: [
          Images.demoIcTouxiang,
          Images.demoIcTouxiang,
          Images.demoIcTouxiang
        ],
        titles: const ['首页', '工作台', '我的'],
        currentIndex: _selectedIndex,
        onTap: (value) {
          setState(() {
            _selectedIndex = value;
          });
          print(value);
        },
      ),
      // bottomNavigationBar: KqBottomTabBar(
      //   iconWidgets: [
      //     Image.asset(Images.homeIcBanbenhao),
      //     Image.asset(Images.homeIcBanbenhao),
      //     Image.asset(Images.homeIcBanbenhao)
      //   ],
      //   activeIconWidgets: [
      //     Image.asset(Images.homeIcTouxiang),
      //     Image.asset(Images.homeIcTouxiang),
      //     Image.asset(Images.homeIcTouxiang)
      //   ],
      //   titleWidgets: const [Text('首页'), Text('工作台'), Text('我的')],
      //   currentIndex: _selectedIndex,
      //   onTap: (value) {
      //     setState(() {
      //       _selectedIndex = value;
      //     });
      //     print(value);
      //   },
      // ),
    );
  }
}
